package nl.saxion.cryptobazen.xmlreader;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import nl.saxion.cryptobazen.model.Partij;
import nl.saxion.cryptobazen.model.Partijen;
import nl.saxion.cryptobazen.model.Persoon;

import com.thoughtworks.xstream.XStream;

public class XmlReader
{

	private static String fileLocation = "kandidatenlijst.xml";

	public static Partijen readPartijen() throws FileNotFoundException
	{
		FileInputStream fileInputStream = new FileInputStream(fileLocation);
		XStream xstream = new XStream();

		Class[] classes = { Partij.class, Persoon.class, Partijen.class };
		xstream.processAnnotations(classes);

		Partijen partijen = (Partijen) xstream.fromXML(fileInputStream);
		return partijen;
	}
}
